<template>
    <div class="aboutLeft">
        <ul>
            <li v-for="item in newsArr" :key="item.id" @click="handleClcik(item.id)">
                {{ item.title }}
            </li>
        </ul>
    </div>
</template>

<script>
export default {
    data() {
        return {
            id: '',
            newsArr: [
                { id: 1, title: '行业资讯' },
                { id: 2, title: '公司新闻' },
            ],
        };
    },
    methods: {
        handleClcik(id) {
            this.$router.push({ path: '/about', query: { id: id, timestamp: Date.now() } });
            this.$emit('update:sortId', id);
        },
    },
    components: {},
    watch: {
        $route: {
            handler(val) {
                let { id } = val.query;
                this.id = id;
                console.log(id);
            },
        },
    },
};
</script>

<style scoped lang="scss">
.aboutLeft {
    ul {
        li {
            padding: 8px;
        }
    }
}
</style>
